#define _CRT_SECURE_NO_WARNINGS 1
//I am a student
//student a am I
#include <stdio.h>
#include <string.h>
void reverse(char* left, char* right)
{
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}

}
//I am a student
//student a am I
int main()
{
	char arr[20];
	gets(arr);
	int len = strlen(arr);
	reverse(arr, arr + len - 1);
	char* cur = arr;
	while (*cur)
	{
		char* start =cur;
		while (*cur!=' '&&*cur!='\0')
		{
			cur++;
		}
		char* end = cur;
		reverse(start, end);
		if(*cur==' ')
		cur++;
	}
	printf("%s", arr);
}
